3.1279 \(\int \tan ^{-1}(x) \log (1+x^2) \, dx\)

Optimal. Leaf size=38 \[ -\frac {1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

[Out]

-2*x*arctan(x)+arctan(x)^2+ln(x^2+1)+x*arctan(x)*ln(x^2+1)-1/4*ln(x^2+1)^2

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.889, Rules used = {4846, 260, 5009, 2475, 2390, 2301, 4916, 4884} \[ -\frac {1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2390

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[((f*x)/d)^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2475

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 4846

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x])^p, x] - Dist[b*c*p, Int[
(x*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^2*x^2), x], x] /; FreeQ[{a, b, c}, x] && IGtQ[p, 0]

Rule 4884

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 4916

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[(d*f^2)/e, Int[((f*x)^(m - 2)*(a + b*ArcTan[c*x])^p)
/(d + e*x^2), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5009

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[(x*(d + e*Log[f + g*x^2]))/(1 + c^2*x^2), x], x] - Di
st[2*e*g, Int[(x^2*(a + b*ArcTan[c*x]))/(f + g*x^2), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rubi steps

\begin {align*} \int \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=x \tan ^{-1}(x) \log \left (1+x^2\right )-2 \int \frac {x^2 \tan ^{-1}(x)}{1+x^2} \, dx-\int \frac {x \log \left (1+x^2\right )}{1+x^2} \, dx\\ &=x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {\log (1+x)}{1+x} \, dx,x,x^2\right )-2 \int \tan ^{-1}(x) \, dx+2 \int \frac {\tan ^{-1}(x)}{1+x^2} \, dx\\ &=-2 x \tan ^{-1}(x)+\tan ^{-1}(x)^2+x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,1+x^2\right )+2 \int \frac {x}{1+x^2} \, dx\\ &=-2 x \tan ^{-1}(x)+\tan ^{-1}(x)^2+\log \left (1+x^2\right )+x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{4} \log ^2\left (1+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 38, normalized size = 1.00 \[ -\frac {1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Integrate[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

________________________________________________________________________________________

fricas [A]  time = 0.39, size = 33, normalized size = 0.87 \[ -2 \, x \arctan \relax (x) + \arctan \relax (x)^{2} + {\left (x \arctan \relax (x) + 1\right )} \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-2*x*arctan(x) + arctan(x)^2 + (x*arctan(x) + 1)*log(x^2 + 1) - 1/4*log(x^2 + 1)^2

________________________________________________________________________________________

giac [B]  time = 0.12, size = 92, normalized size = 2.42 \[ \frac {1}{2} \, \pi x \log \left (x^{2} + 1\right ) \mathrm {sgn}\relax (x) - x \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {3}{2} \, \pi ^{2} \mathrm {sgn}\relax (x) - \pi x \mathrm {sgn}\relax (x) - \pi \arctan \left (\frac {1}{x}\right ) \mathrm {sgn}\relax (x) + \frac {1}{2} \, \pi ^{2} + \pi \arctan \relax (x) + \pi \arctan \left (\frac {1}{x}\right ) + 2 \, x \arctan \left (\frac {1}{x}\right ) + \arctan \left (\frac {1}{x}\right )^{2} - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/2*pi*x*log(x^2 + 1)*sgn(x) - x*arctan(1/x)*log(x^2 + 1) - 3/2*pi^2*sgn(x) - pi*x*sgn(x) - pi*arctan(1/x)*sgn
(x) + 1/2*pi^2 + pi*arctan(x) + pi*arctan(1/x) + 2*x*arctan(1/x) + arctan(1/x)^2 - 1/4*log(x^2 + 1)^2 + log(x^
2 + 1)

________________________________________________________________________________________

maple [C]  time = 1.36, size = 1913, normalized size = 50.34 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(arctan(x)*ln(x^2+1),x)

[Out]

-2*x*arctan(x)+1/2*I*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)^3*Pi*ln((1+I*x)^2/(x^2+1)+1)-1/2*I*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((1+I*x)^2/(x^2+1)+1)*Pi*csgn(I*(1+I*x)^2/(x^2+1)
)*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2-2*arctan(x)*ln((1+I*x)^2/(x^2+1)+1)*x+2*arctan(x)*ln(2)*
x-2*I*ln(2)*arctan(x)-1/2*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2*Pi*ln((1+I*x)^2/(x^2+1)+
1)-I*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*Pi*ln((1+I*x)^2/(x^2+1)+1)+1/2*I*csgn(I*(
1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)*Pi*ln((1+I*x)^2/(x^2+1)+1)+1/2*I*c
sgn(I*((1+I*x)^2/(x^2+1)+1)^2)*csgn(I*((1+I*x)^2/(x^2+1)+1))^2*Pi*ln((1+I*x)^2/(x^2+1)+1)

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 42, normalized size = 1.11 \[ {\left (x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \relax (x)\right )} \arctan \relax (x) - \arctan \relax (x)^{2} - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

(x*log(x^2 + 1) - 2*x + 2*arctan(x))*arctan(x) - arctan(x)^2 - 1/4*log(x^2 + 1)^2 + log(x^2 + 1)

________________________________________________________________________________________

mupad [B]  time = 0.46, size = 39, normalized size = 1.03 \[ \ln \left (x^2+1\right )-\frac {{\ln \left (x^2+1\right )}^2}{4}+{\mathrm {atan}\relax (x)}^2-x\,\left (2\,\mathrm {atan}\relax (x)-\ln \left (x^2+1\right )\,\mathrm {atan}\relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(x^2 + 1)*atan(x),x)

[Out]

log(x^2 + 1) - log(x^2 + 1)^2/4 + atan(x)^2 - x*(2*atan(x) - log(x^2 + 1)*atan(x))

________________________________________________________________________________________

sympy [A]  time = 0.59, size = 39, normalized size = 1.03 \[ x \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\relax (x )} - 2 x \operatorname {atan}{\relax (x )} - \frac {\log {\left (x^{2} + 1 \right )}^{2}}{4} + \log {\left (x^{2} + 1 \right )} + \operatorname {atan}^{2}{\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(atan(x)*ln(x**2+1),x)

[Out]

x*log(x**2 + 1)*atan(x) - 2*x*atan(x) - log(x**2 + 1)**2/4 + log(x**2 + 1) + atan(x)**2

________________________________________________________________________________________